#include "stdafx.h"
#include "Accessory.h"

CAccessory::CAccessory()
{

}
CAccessory::~CAccessory()
{

}

void CAccessory::setType(const int& nType)
{
	m_nType = nType;
}
int CAccessory::getType()const
{
	return m_nType;
}

void CAccessory::setCount(const int& nCount)
{
	m_nCount = nCount;
}
int CAccessory::getCount() const
{
	return m_nCount;
}

void CAccessory::bought()
{

}
void CAccessory::warranty()
{

}
bool CAccessory::pushToDB()
{ 
	return true;
}
bool CAccessory::updateDB()
{ 
	return true;
}
bool CAccessory::removeOutDB()
{
	return true;
}
 void CAccessory::copy(const CProduct* pProdcut)
{
	CProduct::copy(pProdcut);
	if(typeid(*pProdcut) == typeid(CAccessory))
	{
		CAccessory* pProductCopy = (CAccessory*)pProdcut;
		m_nType = pProductCopy->getType();

	}
}
CProduct* CAccessory::clone()
{
	CAccessory* pAccNew = new CAccessory();
	
	pAccNew->copy(this);
	return pAccNew;
	
}